home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UTIL / SYS / BOOTUP / !Boot / Code < prev    next >
Text File  |  1991-07-18  |  2KB  |  99 lines

  1.  REM >!Runimage
  2. ON ERROR SYS "Wimp_ReportError",FNerrblk(ERR,REPORT$),1,"Boot":SYS "Wimp_CloseDown":END
  3.  DIM name &100, block &100
  4.  SYS "Wimp_Initialise",200,&4B534154,"Boot"
  5.  SYS "Wimp_Poll",0,block
  6.  
  7. *CLOSE
  8. REM close all open Obey files.
  9.  
  10. REM get screen parameters
  11. block!0 = 4
  12. block!4 = 5
  13. block!8 = 11
  14. block!12= 12
  15. block!16= -1
  16. SYS"OS_ReadVduVariables",block,block+20
  17. dx%=1<<(block!20)
  18. dy%=1<<(block!24)
  19. scrx1%=(block!28+1)*dx%
  20. scry1%=(block!32+1)*dy%
  21.  
  22.   *IconSprites <Boot$Path>.!Sprites
  23.   DIM mainblock 400
  24.   maxws=500
  25.   DIM ws maxws
  26.   wsend=ws+maxws
  27.   SYS "Wimp_OpenTemplate",,"<Boot$Path>.Templates"
  28.   SYS "Wimp_LoadTemplate",,mainblock,ws,wsend,-1,"Startup",0 TO ,,ws
  29.   SYS "Wimp_CreateWindow",,mainblock TO mainwindow
  30.   SYS "Wimp_CloseTemplate"
  31.   !block=mainwindow
  32.   block!4=!mainblock
  33.   block!8=mainblock!4
  34.   block!12=mainblock!8
  35.   block!16=mainblock!12
  36.   block!20=(scrx1%-400)/2
  37.   block!24=(scry1%-200)/2
  38.   block!28=-1
  39.   SYS "Wimp_OpenWindow",,block
  40.  
  41.   PROCpoll
  42.  
  43.  *Dir <Boot$Path>.Boot
  44.  seq=0
  45.  number=0
  46.  length=0:REPEAT
  47.   *Dir <Boot$Path>.Boot
  48.    SYS "OS_GBPB",8,,name,1,seq TO ,,,number, seq
  49.    IF number=0 THEN
  50.      name?(1+?name)=13
  51.      name$=$(name+1)
  52.      path$="<Boot$Path>.Boot."+name$+".!Boot"
  53.      OSCLI "Wimptask "+path$
  54.   PROCpoll
  55.      ENDIF
  56.    UNTIL number
  57.  *Dir <Boot$Path>.Run
  58.  seq=0
  59.  number=0
  60.  length=0:REPEAT
  61.    *Dir <Boot$Path>.Run
  62.    SYS "OS_GBPB",8,,name,1,seq TO ,,,number, seq
  63.    IF number=0 THEN
  64.      name?(1+?name)=13
  65.      name$=$(name+1)
  66.      path$="<Boot$Path>.Run."+name$
  67.      OSCLI "Wimptask "+path$
  68.   PROCpoll
  69.      ENDIF
  70.    UNTIL number
  71.  !block=mainwindow
  72.  SYS "Wimp_CloseWindow",,block
  73.  SYS "Wimp_CloseDown"
  74.  END
  75.  
  76. DEFFNerrblk(err%,report$)
  77.   !errblock=err%
  78.   $(errblock+4)=report$+" at line "+STR$ERL
  79.   errblock?(4+LEN$(errblock+4))=0
  80. =errblock
  81.  
  82. DEFPROCpoll
  83. REPEAT
  84.   SYS "Wimp_Poll",0,block TO reason
  85.   CASE reason OF
  86.     WHEN 2 :
  87.      !block=mainwindow
  88.      block!4=!mainblock
  89.      block!8=mainblock!4
  90.      block!12=mainblock!8
  91.      block!16=mainblock!12
  92.      block!20=(scrx1%-400)/2
  93.      block!24=(scry1%-200)/2
  94.      block!28=-1
  95.      SYS "Wimp_OpenWindow",,block
  96.     ENDCASE
  97. UNTIL reason=0
  98. ENDPROC
  99.